//
//  BaseChildViewController.swift
//  KkmhSwift
//
//  Created by tenltrs on 2018/11/12.
//  Copyright © 2018 Tenltrs. All rights reserved.
//

import UIKit

class BaseChildViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        view.backgroundColor=UIColor.white
    }
    

    deinit {
        logger.info("销毁子控制器 ==== \(String(describing: self.classForCoder))")
        
        //取消当前界面网络请求
        self.sessionManager?.session.getAllTasks(completionHandler: { (tasks) in
            tasks.forEach({ (task) in
                let url = task.currentRequest?.url?.absoluteString
                logger.info(String(format: "取消请求 ==== %@", url!))
                task.cancel()
            })
        })
    }

}
